package spring.aop.case1.service;

import spring.jdbc.JsrDAO;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.annotation.Resource;
import javax.inject.Inject;
import javax.inject.Named;

@Named
//@Service
public class JsrService {
    //@Resource
    @Inject
    private JsrDAO jsrDAO;

    public void save() {
        jsrDAO.save();
    }

    @Resource
    public void setJsrDAO(JsrDAO jsrDAO) {
        this.jsrDAO = jsrDAO;
    }

    @PostConstruct
    public void init() {
        System.out.println("@PostConstruct");
    }

    @PreDestroy
    public void destroy() {
        System.out.println("@PreDestroy");
    }
}
